package com.awesome.designpatterndemo.proxy.proxy2;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.awesome.designpatterndemo.R;

public class Proxy2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_proxy2);
        // 构造一个小民
        ILawsuit xioamin = new XiaoMin();
        // 构造一个代理律师将小民作为构造参数传递进去
        ILawsuit lawyer = new Lawyer(xioamin);
        // 律师去提交诉讼
        lawyer.submit();
        // 律师进行举证
        lawyer.burden();
        // 律师代替小民辩护
        lawyer.defend();
        // 律师完成诉讼
        lawyer.finish();
    }
}